home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / Sample Editors⁄Viewers / Panel Editor / Source / Selection.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-08  |  1.9 KB  |  92 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Selection.h
  3.  
  4.     Contains:    Selection class implementation
  5.  
  6.     Written by:    Steve Smith
  7.     
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11. #ifndef _SELECTION_
  12. #define _SELECTION_
  13.  
  14. // -- Compiler/Preprocessor Switches --
  15.  
  16. #ifndef _COMPILERDEFS_
  17. #include "CompDefs.h"
  18. #endif
  19.  
  20. // -- PanelEditor Includes --
  21.  
  22. #ifndef _SAMPLECOLLECTIONS_
  23. //#include "SampleCollections.h"
  24. #endif
  25.  
  26. #ifndef _LISTITEM_
  27. //#include "ListItem.h"
  28. #endif
  29.  
  30. #ifndef _UNDOPE_
  31. //#include "UndoPE.h"
  32. #endif
  33.  
  34. // -- OpenDoc Includes --
  35.  
  36. #ifndef _ODTYPES_
  37. #include <ODTypes.h>
  38. #endif
  39.  
  40. class ODStorageUnit;
  41. class ODSession;
  42. class PanelEditor;
  43. class CListItem;
  44. class CList;
  45. class CUndo;
  46.  
  47. class CSelection {
  48.  
  49.     public:
  50.     CSelection(PanelEditor* owner, ODSession* session);
  51.     virtual ~CSelection();
  52.             
  53.     void        InitSelection();
  54.     void        Add(Environment* ev, CListItem* item);
  55.     void        Remove(Environment* ev, CListItem* item);
  56.     void        Empty(Environment* ev, ODBoolean update = kODTrue);
  57.     ODBoolean    IsEmpty();
  58.     void        ClearItems(Environment* ev);
  59.     CList*        CaptureItems();
  60.     void        Activate(Environment* ev, ODFrame* frame, ODBoolean activate);
  61.     
  62.     void        Write(Environment* ev, ODStorageUnit* storageUnit);    
  63.     
  64.     void        Cut(Environment* ev, ODFrame* frame);
  65.     void        Copy(Environment* ev, ODFrame* frame);
  66.     void        Clear(Environment* ev, ODFrame* frame);
  67.     void        ShowPartInfo(Environment* ev, ODFrame* frame);
  68.     
  69.     void        PushUndoState(Environment* ev, ODUShort undoType, ODActionType actionType);
  70.     void        Undo(Environment* ev, CUndo* action);
  71.     void        Redo(Environment* ev, CUndo* action);
  72.     
  73.     ODBoolean    CheckForDrag(Environment* ev, ODEventData* event);
  74.     void        Drag(Environment* ev, ODFacet* facet, ODEventData* event,
  75.                             ODEventInfo* eventInfo);
  76.     
  77.     CListItem*    GetFirstItem();
  78.     CListItem*    GetLastItem();
  79.     
  80.     //ODBoolean    HitTest(Environment* ev, ODFacet* facet);
  81.     
  82.     protected:
  83.     CSelection() {}
  84.  
  85.     private:
  86.     ODBoolean        fInited;
  87.     CList*            fItems;
  88.     PanelEditor*    fOwner;
  89.     ODSession*        fSession;
  90. };
  91.  
  92. #endif